package util

import (
	"encoding/json"
	"github.com/stretchr/testify/assert"
	"testing"
)

// ToString 将 JSON 格式的结构体转换为 string
func ToString(t *testing.T, v interface{}) string {
	bytes, err := json.Marshal(v)
	assert.NoError(t, err)
	return string(bytes)
}
